package nz.ac.massey.cs.se400_2013.ass3.tests;

import static org.junit.Assert.*;

import java.util.Collection;

import nz.ac.massey.cs.se400_2013.ass3.Paper;
import nz.ac.massey.cs.se400_2013.ass3.Student;

import org.junit.Test;

public class ReferenceTest {

	@Test
	public  void testAddStudent(){
		Student student1 = new Student();
		Student student2 = new Student();
		Paper paper = new Paper();
		paper.addStudent(student1);
		paper.addStudent(student2);
		Collection<Paper> student1Papers = student1.getPapers();
		Collection<Paper> student2Papers = student1.getPapers();
		Collection<Student> paperStudents = paper.getEnrolledStudents();
		assertTrue(student1Papers.contains(paper));
		assertTrue(student2Papers.contains(paper));
		assertTrue(paperStudents.contains(student1));
		assertTrue(paperStudents.contains(student2));
		assertEquals(2, paperStudents.size());
		assertEquals(1, student1Papers.size());
		assertEquals(1, student2Papers.size());
	}
	
}
